<!DOCTYPE html>
<html>

<head>
    <title>Preview Display</title>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
    <link rel="shortcut icon" href="custom/images/favicon.ico?v=2" />
    <style>
        html,
        body {
            overflow: hidden;
            padding: 0px;
            margin: 0px;
        }
        #map,#mycanvas{
            margin-top: 35px;
            margin-left: 340px;
            /*pointer-events:none;*/
            /*z-index: 1;*/
            position:absolute;
            /*left: -60px;*/
            width: 1000px;
            height:805px;
            border: 0pc;
            /*background-color: black*/
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }
    /*    #map,#mycanvas{
            margin-top: 40px;
            margin-left: 0px;
            !*pointer-events:none;*!
            !*z-index: 1;*!
            position:absolute;
            !*left: -60px;*!
            width: 100%;
            height:calc(100% - 40px);
            border: 0pc;
            !*background-color: black*!
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }*/
        .leaflet-top {
            visibility: hidden;
        }
        .leaflet-right {
            visibility: hidden;
        }
        .leaflet-dragging{

        }
		
    </style>
<!-- <script src='../custom/libs/jquery-3.4.1.min.js'></script> -->
    <!-- <script src='../custom/libs/echarts.js'></script> -->
    <!-- <script src='../custom/libs/echarts.min.js'></script> -->
    <!-- <script src='../custom/libs/china.js'></script> -->

    <!-- <script src='../custom/configs/htconfig.js'></script> -->
    <!-- <script src='../libs/knU3sXefAa5Q.js'></script> -->
    <!-- <script src='../libs/ht.js'></script> -->
    <!-- <script src='../libs/buckle.js'></script> -->
    <!-- <script src='../libs/ht-edgetype.js'></script> -->
    <!-- <script src='../libs/ht-ui.js'></script> -->
    <!-- <script src='../libs/ht-vector.js'></script> -->
    <!-- <script src='../libs/ht-animation.js'></script> -->

    <!-- <script src='../custom/configs/urlConfig.js'></script> -->
	<script src='../libs/core/IZrowIfUVaXF.js'></script>
    <script src='../libs/core/VT3MIEkV8AKv.js'></script>
    <script src='../libs/core/ht.js'></script>
    <script src='../libs/core/buckle.js'></script>
    <script src='../libs/core/ht-ui.js'></script>

    <script src='../libs/plugin/ht-edgetype.js'></script>
    <script src="../libs/plugin/ht-obj.js"></script>
    <script src='../libs/plugin/ht-form.js'></script>
    <script src='../libs/plugin/ht-vector.js'></script>
    <script src='../libs/plugin/ht-animation.js'></script>
    <script src='../configs/htconfig.js'></script>
    <!-- <script src="../libs/china.js"></script> -->
    <script src="../libs/echarts.min.js"></script>
    <script src='../libs/echarts.js'></script>
    <script src='../libs/jquery-3.4.1.min.js'></script>
    <script src='../libs/echarts.js'></script>
    <script src='../libs/buckle.js'></script>
    <script src='../libs/knU3sXefAa5Q.js'></script>
	
	<script src="../configs/urlConfig.js"></script>
    <script>
        var fiveFieldMap = [
            {
                "id": 5,
                "name": "张家口",
                "position": {
                    'x': 650,
                    'y': 300
                },
                'value': 12,
                'volume': '200MW'
            },
            {
                "id": 6,
                "name": "唐山",
                "position": {
                    'x': 1040,
                    'y': 500
                },
                'value': 12,
                'volume': '200MW'
            },
            {
                "id": 7,
                "name": "廊坊",
                "position": {
                    'x': 780,
                    'y': 630
                },
                'value': 12,
                'volume': '200MW'
            },
            {
                "id": 8,
                "name": "承德",
                "position": {
                    'x': 950,
                    'y': 250
                },
                'value': 12,
                'volume': '200MW'
            },
            {
                "id": 9,
                "name": "秦皇岛",
                "position": {
                    'x': 1180,
                    'y': 450
                },
                'value': 12,
                'volume': '200MW'
            }
        ];//五市风机图标
        var stationsMap=[];//各个区域场站
        var windFieldMap = [
            {
                "id": 1000,
                "name": "杨城子风电场",
                "position": {
                    'x': 900,
                    'y': 660
                },
                'value': 12,
                'volume': '200MW'
            },
            {
                "id": 1001,
                "name": "张家口风电场",
                "position": {
                    'x': 1154,
                    'y': 302,
                },
                'value': 12,
                'volume': '208MW'
            },
            {
                "id": 1002,
                "name": "承德风电场",
                "position": {
                    'x': 1151,
                    'y': 648
                },
                'value': 12,
                'volume': '205MW'
            },
            {
                "id": 1003,
                "name": "秦皇岛风电场",
                "position": {
                    'x': 1297,
                    'y': 562
                },
                'value': 12,
                'volume': '201MW'
            },
            {
                "id": 1004,
                "name": "唐山风电场",
                "position": {
                    'x': 682,
                    'y': 338
                },
                'value': 12,
                'volume': '202MW'
            }
        ];//风电场图标

        var startId = 0;//报警信息播放
        var maxPageNum=0;//报警信息播放
        var showTableData = [];
        var tabledata = [
            /*{
                "id": "123",
                "reason": "2019.06.09-17:03 张家口风电场 发电能力缺陷 5台"
            }*/
        ];//循环报警事故记录
        var alarmid="1004alarm";//风电厂悬浮报警框

        var dataModel = new ht.DataModel();
        var graphView;

        var view1;//地区图纸view，ht使用
        var mapFlag=1;//风向图是否打开标识
        var stationId=0;
        var stationId_old=0;
        var areaId;

        var layMap;//地图全局赋值使用
        var timer;
        var timerStop=0;
        var timeBarValue=0;//进度条
        var timerWindDataNum=0;//气象当前第几条数据
        var timerWindDataTotalNum=0;//气象数据条数
        function changeMapFlag(){
            if(mapFlag==1){
                changeMapClose();
            }else{
                changeMapOpen();
            }
        }
        //open打开地图定时刷新，ht暂停重新打开也打开定时刷新
        function changeMapOpen() {
            mapFlag=1;
            timeBarValue=0;
            timerWindDataNum=0;
            clearInterval(timer);
            $('#map').show();
            dataModel.getDataByTag('timebarBlock').s('2d.visible', true);
            dataModel.getDataByTag('push').s('select.width',0);
            dataModel.getDataByTag('back').s('select.width',0);
            dataModel.getDataByTag('stop').s('select.width',0);
            timer=setInterval(function () {
                timeBarValue=timeBarValue+0.01;
                timerWindDataNum=timerWindDataNum+1;
                if(timerWindDataNum==timerWindDataTotalNum-1){
                    timerWindDataNum=0;
                }
                if(timeBarValue>1){
                    timeBarValue=0;
                }
                // console.log(timeBarValue);
                // console.log(timerWindDataNum);
                var length=dataModel.getDataByTag('timeBar');
                length.a("pb.value",timeBarValue);
                getWinddata(timerWindDataNum);
            },5000);
        }
        function changeMapClose() {
            mapFlag=0;
            timeBarValue=0;
            timerWindDataNum=0;
            clearInterval(timer);
            $('#map').hide();
            if(dataModel.getDataByTag('timebarBlock')!==undefined){//第一次进页面
                dataModel.getDataByTag('timebarBlock').s('2d.visible', false);
                dataModel.getDataByTag('windButton').a('ht.textColor',"#737373");
                dataModel.getDataByTag('windButton').a('ht.borderColor',"#737373");
            }
        }
        function push() {
            timeBarValue=timeBarValue+0.04;
            timerWindDataNum=timerWindDataNum+4;
            if(timeBarValue>1){
                timeBarValue=0;
                timerWindDataNum=0;
            }
            if(timerWindDataNum==timerWindDataTotalNum-1){
                timeBarValue=0;
                timerWindDataNum=0;
            }
            var length=dataModel.getDataByTag('timeBar');
            length.a("pb.value",timeBarValue);
        }
        function back() {
            timeBarValue=timeBarValue-0.04;
            timerWindDataNum=timerWindDataNum-4;
            console.log(timeBarValue);
            console.log(timerWindDataNum);
            if(timeBarValue<0){
                timeBarValue=0;
                timerWindDataNum=0;
            }
            if(timerWindDataNum<0){
                timeBarValue=0;
                timerWindDataNum=0;
            }
            var length=dataModel.getDataByTag('timeBar');
            length.a("pb.value",timeBarValue);
        }
        function stop() {
            if(timerStop==0){
                timerStop=1;
                clearInterval(timer);
            }else{
                timerStop=0;
                timer=setInterval(function () {
                    timeBarValue=timeBarValue+0.01;
                    timerWindDataNum=timerWindDataNum+1;
                    if(timeBarValue>1){
                        timeBarValue=0;
                    }
                    if(timerWindDataNum==timerWindDataTotalNum-1){
                        timerWindDataNum=0;
                    }
                    var length=dataModel.getDataByTag('timeBar');
                    length.a("pb.value",timeBarValue);
                    getWinddata(timerWindDataNum);
                },5000);
            }
        }
        //获取城市下拉框，以及默认地图5市
        function getCity(dataModel){
            $.ajax({
                type : "GET",
                async : false, //同步请求
                // url : attributeConfig.url+"areas",
                url : attributeConfig.url+"/epplatform/v1/resourceMeteorological/getAreas",
                contentType: "application/json; charset=utf-8",
                success:function(data){
                    if(data.code==0){
                        var cityBox=dataModel.getDataByTag('cityBox');
                        var toData=[{
                            label:"冀北",
                            value:"0"
                        }];
                        data.data.forEach(function (e) {
                            let obj={};
                            obj.label=e.pro_name;
                            obj.value=e.id;
                            toData.push(obj);
                        })
                        cityBox.a('ht.dataSource',toData);
                        //5市节点数据
                        fiveFieldMap=[];
                        data.data.forEach(function (e) {
                            let obj={};
                            obj.id=e.id;
                            obj.name=e.pro_name;
                            if(e.postion==undefined){
                                obj.position={
                                    'x': 960,
                                    'y': 540
                                }
                            }else{
                                obj.position={
                                    'x': JSON.parse(e.postion).x,
                                    'y': JSON.parse(e.postion).y
                                }
                            }
                            obj.value=12;
                            obj.volume='200MW';
                            fiveFieldMap.push(obj);
                        })
                        console.log(fiveFieldMap)
                    }
                },
                error: function() {
                    console.log("请求城市失败，请稍后再试！");
                }
            });

            $.ajax({
                type : "GET",
                async : true, //同步请求
                url : attributeConfig.url+"/epplatform/v1/electricStations",
                contentType: "application/json; charset=utf-8",
                success:function(data){
                    if(data.code==0){

                    }
                },
                error: function() {
                    console.log("请求风电场失败，请稍后再试！");
                }
            });
        }
        //5市报警灯是否显示
        function getCityAlarm(){
            var obj=[];
            $.ajax({
                type : "GET",
                async : false, //同步请求
                url : attributeConfig.url+"/epplatform/v1/resourceMeteorological/getAreaWarning",
                contentType: "application/json; charset=utf-8",
                success:function(data){
                    if(data.code==0){
                        obj=data.data;
                    }
                },
                error: function() {
                    console.log("请求城市报警信息失败，请稍后再试！");
                }
            });
            return obj;
        }
        //选择地市，查询下面场站
        function getStationByArea(key){
            var stations=[];
            $.ajax({
                type : "GET",
                async : false, //同步请求
                data:{
                    "area":key
                },
                url : attributeConfig.url+"/epplatform/v1/resourceMeteorological/getStationByArea",
                contentType: "application/json; charset=utf-8",
                success:function(data){
                    if(data.code==0){
                        stations= data.data;
                    }
                },
                error: function() {
                    console.log("请求城市失败，请稍后再试！");
                }
            });
            return stations;
        }
        //获取滚动报警记录
        function getAllPowerError(){
            $.ajax({
                type : "GET",
                async : false, //同步请求
                url : attributeConfig.url+"/epplatform/v1/resourceMeteorological/getAllPowerError",
                contentType: "application/json; charset=utf-8",
                success:function(data){
                    if(data.code==0){
                        console.log(data.data);
                        dataModel.getDataByTag('AllPowerError').s('text', data.data+"(MW)");
                    }
                },
                error: function() {
                    console.log("请求预测偏差失败，请稍后再试！");
                }
            });
        }
        //获取滚动报警记录
        function getWarningAccidentRecord(){
            var stations=[];
            $.ajax({
                type : "GET",
                async : false, //同步请求
                url : attributeConfig.url+"/epplatform/v1/resourceMeteorological/getWarningAccidentRecord",
                contentType: "application/json; charset=utf-8",
                success:function(data){
                    if(data.code==0){
                        tabledata=[];
                        if(data.data.length==0){
                            var obj={
                                "id":"",
                                "reason":"暂无报警记录"
                            }
                            tabledata.push(obj);
                        }else{
                            data.data.forEach(function (e) {
                                var obj={
                                    "id":"",
                                    "reason":e.date+" "+e.area+"地区"+e.cnt+"个风电场有极端天气报警"
                                }
                                tabledata.push(obj);

                            })
                        }
                        console.log(tabledata);
                    }
                },
                error: function() {
                    console.log("请求报警记录失败，请稍后再试！");
                }
            });
            return stations;
        }
        //获取5市的风机悬浮提示信息
        function getcitywindtooltipArr(key){
            var arr=[];
            $.ajax({
                type : "GET",
                async : false, //同步请求
                data:{
                    "area":key
                },
                url : attributeConfig.url+"/epplatform/v1/resourceMeteorological/getPrecisionTop5",
                contentType: "application/json; charset=utf-8",
                success:function(data){
                    if(data.code==0){
                        data.data.forEach(function (e) {
                            let obj={};
                            obj.reason=e.station+":"+e.power;
                            arr.push(obj);
                        })
                    }
                },
                error: function() {
                    console.log("请求城市失败，请稍后再试！");
                }
            });
            return arr;
        }
        //获取场站的风机悬浮提示信息
        function getstationwindtooltipArr(key){
            var arr=[];
            $.ajax({
                type : "GET",
                async : false, //同步请求
                data:{
                    "area":key
                },
                url : attributeConfig.url+"/epplatform/v1/resourceMeteorological/getStationForecast",
                contentType: "application/json; charset=utf-8",
                success:function(data){
                    if(data.code==0){
                        data.data.forEach(function (e) {
                            let obj={};
                            obj.reason="计算准确率:"+e.calculationAccuracy;
                            arr.push(obj);
                            let obj2={};
                            obj2.reason="装机容量:"+e.installedCapacity;
                            arr.push(obj2);
                            let obj3={};
                            obj3.reason="实时功率:"+e.realPower;
                            arr.push(obj3);
                            let obj4={};
                            obj4.reason="预测功率:"+e.forecastPower;
                            arr.push(obj4);
                            let obj5={};
                            obj5.reason="合格率:"+e.passRate;
                            arr.push(obj5);
                            /*let obj6={};
                            obj6.reason="上报准确率:"+e.reportingAccuracy;
                            arr.push(obj6);*/

                        })
                    }
                },
                error: function() {
                    console.log("请求城市失败，请稍后再试！");
                }
            });
            return arr;
        }
        //切换电站，定时器会监听到改变
        function changeStation(areaId1,stationId1) {
            areaId=areaId1;
            stationId=stationId1;
        }

        function init() {
            changeMapClose();
            document.getElementById("ht").innerHTML = "";
            var gd2 = new ht.graph.GraphView();
            view1=gd2;
            gd2.addToDOM(document.getElementById("ht"));
            gd2.deserialize('displays/冀北/资源评估与气象预警/ditu6.json', function (json, dm, g2d, datas) {
                // TODO 2D 反序列化完成回调，后面会讲到
                getCity(dataModel);//获取城市下拉框，以及默认地图5市
                var getCityAlarmObj=getCityAlarm();//5市报警灯是否显示
                createNodes(dm, fiveFieldMap,getCityAlarmObj);//5市创建节点,包含5个风机，和报警灯是否显示
                gd2.addInteractorListener(e => {
                    var kind = e.kind;
                    var data = e.data;
                    var id;
                    if (data) {
                        id = data._id;
                    }
                    //报警灯提示框
                    var alarmTemp;
                    for (var i = 0; i < fiveFieldMap.length; i++) {
                        if (fiveFieldMap[i].id+"alarm" == id) {
                            alarmTemp = fiveFieldMap[i];
                            break;
                        }
                    }
                    if(alarmTemp){
                        var layers = gd2.getLayers();
                        layers[2].visible = true;
                        var position = data._position;
                        var alarmCityTbale2 = dm.getDataByTag('alarmCityTbale');
                        if ('onHover' == kind) {
                            var reasons=[];
                            getCityAlarmObj[alarmTemp.name].forEach(function (e) {
                                let obj={};
                                obj.reason=e.station+"大风预警"+e.wind_level+"级";
                                reasons.push(obj);
                            })
                            alarmCityTbale2._position.x = position.x + 180;
                            alarmCityTbale2._position.y = position.y + 100;
                            alarmCityTbale2.a({
                                'ht.dataSource': reasons
                            });
                            alarmCityTbale2.s('2d.visible', true);
                        }else if ('onLeave' === kind) {
                            alarmCityTbale2.s('2d.visible', false);
                        }
                    }

                    //风机提示框,根据悬浮id查排行前5
                    var temp;
                    var windtooltipArr=[];
                    for (var i = 0; i < fiveFieldMap.length; i++) {
                        if (fiveFieldMap[i].id == id) {
                            temp = fiveFieldMap[i];
                            break;
                        }
                    }
                    if (temp) {
                        var layers = gd2.getLayers();
                        layers[2].visible = true;
                        var position = data._position;

                        var alarmCityTbale2 = dm.getDataByTag('alarmCityTbale');
                        if ('onHover' == kind) {
                            windtooltipArr=getcitywindtooltipArr(id);
                            alarmCityTbale2._position.x = position.x - 250;
                            alarmCityTbale2._position.y = position.y + 50;
                            alarmCityTbale2.a({
                                'ht.dataSource': windtooltipArr
                            });
                            alarmCityTbale2.s('2d.visible', true);
                        }else if ('onLeave' === kind) {
                            alarmCityTbale2.s('2d.visible', false);
                        }
                    }

                });
            });
            // gd2.setScrollBarVisible(false)
            ht.Default.xhrLoad('displays/冀北/资源评估与气象预警/资源评估气象预警.json', function (text) {
                var json = ht.Default.parse(text);
                if (json.title) document.title = json.title;
                dataModel.deserialize(json);
                dataModel.getDataByTag('windButton').s('2d.visible', true);
                getAllPowerError();
                getWarningAccidentRecord();
                //获取时间数据
                var time = (new Date).getTime() - 24 * 60 * 60 * 1000;
                var yesday = new Date(time); // 获取的是前一天日期
                //给表格数据添加上id
                running(tabledata);
                //初始化表格
                changeData(tabledata, startId, showTableData);//解决初始化空白
                if(tabledata.length>4){
                    setInterval(function () {
                        startId = changeData(tabledata, startId, showTableData)
                    }, 3 * 1000);
                }
                var date=new Date();
                var year=date.getFullYear();
                dataModel.getDataByTag('yearTime1').a('ht.value', year.toString());
                getwindSpeedChart(year);
            });
            graphView = new ht.graph.GraphView(dataModel);
            graphView.addToDOM(gd2.getView());
            graphView.setScrollBarVisible(false);
        }
        function jibei() {
            stationsMap=[];
            dataModel.getDataByTag('stations_comboBox').a('ht.dataSource',stationsMap);
            dataModel.getDataByTag('stations_comboBox').a('ht.value',"所有");

            document.getElementById("ht").innerHTML = "";
            var gd2 = new ht.graph.GraphView();
            gd2.addToDOM(document.getElementById("ht"));
            gd2.deserialize('displays/冀北/资源评估与气象预警/ditu6.json', function (json, dm, g2d, datas) {
                // gd2.s('fullscreen', "fill");
                // gd2.s('fullscreen.lock', "h");
                dataModel.getDataByTag('windButton').s('2d.visible', true);
                // TODO 2D 反序列化完成回调，后面会讲到
                //createNodes(dm, windFieldMap);
                var getCityAlarmObj=getCityAlarm();//5市报警灯是否显示
                createNodes(dm, fiveFieldMap,getCityAlarmObj);//5市创建节点,包含5个风机，和报警灯是否显示

                gd2.addInteractorListener(e => {
                    var kind = e.kind;
                    var data = e.data;
                    var id;
                    if (data) {
                        id = data._id;
                    }
                    //报警灯提示框
                    var alarmTemp;
                    for (var i = 0; i < fiveFieldMap.length; i++) {
                        if (fiveFieldMap[i].id+"alarm" == id) {
                            alarmTemp = fiveFieldMap[i];
                            break;
                        }
                    }
                    if(alarmTemp){
                        var layers = gd2.getLayers();
                        layers[2].visible = true;
                        var position = data._position;
                        var alarmCityTbale2 = dm.getDataByTag('alarmCityTbale');
                        if ('onHover' == kind) {
                            var reasons=[];
                            getCityAlarmObj[alarmTemp.name].forEach(function (e) {
                                let obj={};
                                obj.reason=e.station+"大风预警"+e.wind_level+"级";
                                reasons.push(obj);
                            })
                            alarmCityTbale2._position.x = position.x + 180;
                            alarmCityTbale2._position.y = position.y + 100;
                            alarmCityTbale2.a({
                                'ht.dataSource': reasons
                            });
                            alarmCityTbale2.s('2d.visible', true);
                        }else if ('onLeave' === kind) {
                            alarmCityTbale2.s('2d.visible', false);
                        }
                    }

                    //风机提示框,根据悬浮id查排行前5
                    var temp;
                    var windtooltipArr=[];
                    for (var i = 0; i < fiveFieldMap.length; i++) {
                        if (fiveFieldMap[i].id == id) {
                            temp = fiveFieldMap[i];
                            break;
                        }
                    }
                    if (temp) {
                        var layers = gd2.getLayers();
                        // console.log(layers)
                        layers[2].visible = true;
                        //console.log('temp',temp);
                        var position = data._position;

                        var alarmCityTbale2 = dm.getDataByTag('alarmCityTbale');
                        if ('onHover' == kind) {
                            windtooltipArr=getcitywindtooltipArr(id);
                            // console.log(windtooltipArr)
                            alarmCityTbale2._position.x = position.x - 250;
                            alarmCityTbale2._position.y = position.y + 50;
                            alarmCityTbale2.a({
                                'ht.dataSource': windtooltipArr
                            });
                            alarmCityTbale2.s('2d.visible', true);
                        }else if ('onLeave' === kind) {
                            alarmCityTbale2.s('2d.visible', false);
                        }
                    }

                });
            });
            graphView.addToDOM(gd2.getView());//没有gd2.getView()，地图上的弹出框出不来
        }
        function chengde(key) {
            windFieldMap = [];
            stationsMap=[];
            //查看该市下有哪些变电站
            var stations=getStationByArea(key);
            //变电站数据规范化，HT数据格式保持一致
            stations.forEach(function (e) {
                let obj={};
                obj.id=e.id;
                obj.name=e.pro_name;
                if(e.postion==undefined){
                    obj.position={
                        'x': 960,
                        'y': 540
                    }
                }else{
                    obj.position={
                        'x': JSON.parse(e.postion).x,
                        'y': JSON.parse(e.postion).y
                    }
                }
                obj.value=12
                obj.volume='200MW'
                windFieldMap.push(obj)

                let stationObj={};
                stationObj.label=e.pro_name;
                stationObj.value=e.id;
                stationsMap.push(stationObj);
            })
            document.getElementById("ht").innerHTML = "";
            var gd2 = new ht.graph.GraphView();
            view1=gd2;
            dataModel.getDataByTag('stations_comboBox').a('ht.dataSource',stationsMap);
            dataModel.getDataByTag('stations_comboBox').a('ht.value',"所有");
            gd2.addToDOM(document.getElementById("ht"));
            gd2.deserialize('displays/冀北/资源评估与气象预警/chengde.json', function (json, dm, g2d, datas) {
                dataModel.getDataByTag('windButton').s('2d.visible', false);//风向图隐藏
                createNodes2(dm, windFieldMap,"chengde");
                gd2.addInteractorListener(e => {
                    var kind = e.kind;
                    var data = e.data;
                    var id;
                    if (data) {
                        id = data._id;
                    }
                    //悬浮报警灯
                    if(id==alarmid){
                        // var layers = gd2.getLayers();
                        // layers[2].visible = true;
                        //console.log('temp',temp);
                        var position = data._position;
                        var alarmCityTbale2 = dm.getDataByTag('alarmCityTbale2');
                        if ('onHover' == kind) {
                            alarmCityTbale2._position.x = position.x - 180;
                            alarmCityTbale2._position.y = position.y + 100;
                            alarmCityTbale2.a({
                                'ht.dataSource': [
                                    {
                                        "reason": "天桥山风电场 大风报警5级 功率损失：1224wv"
                                    },
                                    {
                                        "reason": "鹿原风电场 大风报警5级 功率损失：1024MW"
                                    }
                                ]
                            });
                            alarmCityTbale2.s('2d.visible', true);
                        }else if ('onLeave' === kind) {
                            alarmCityTbale2.s('2d.visible', false);
                        }
                    }

                    var temp;
                    for (var i = 0; i < windFieldMap.length; i++) {
                        if (windFieldMap[i].id == id) {
                            temp = windFieldMap[i];
                            break;
                        }
                    };
                    //悬浮风电场
                    if (temp) {
                        // var layers = gd2.getLayers();
                        // console.log(layers)
                        // layers[2].visible = true;
                        // console.log(temp);
                        var position = data._position;

                        var alarmCityTbale2 = dm.getDataByTag('alarmCityTbale2');
                        if ('onHover' == kind) {//暂时不用
                            var arr=getstationwindtooltipArr(temp.id);
                            // console.log(arr)
                            alarmCityTbale2._position.x = position.x - 180;
                            alarmCityTbale2._position.y = position.y + 100;
                            alarmCityTbale2.a({
                                'ht.dataSource': arr
                            });
                            alarmCityTbale2.s('2d.visible', true);
                        }else if ('onLeave' === kind) {
                            alarmCityTbale2.s('2d.visible', false);
                        }
                    }

                });
            });
            setInterval(function () {
                if(stationId_old!=stationId&&areaId==8){
                    if(stationId_old!==0){
                        gd2.zoomReset(true, {x: view1.getDataModel().getDataByTag(stationId_old)._position.x, y: view1.getDataModel().getDataByTag(stationId_old)._position.y});
                    }
                    gd2.setZoom(1.5, true, {x: view1.getDataModel().getDataByTag(stationId)._position.x, y: view1.getDataModel().getDataByTag(stationId)._position.y});
                    var layers = view1.getLayers();
                    layers[1].visible = true;
                    layers[2].visible = true;
                    stationId_old=stationId;
                }
            }, 1000);
            graphView.addToDOM(gd2.getView());//没有gd2.getView()，地图上的弹出框出不来
        }
        function zhangjiakou(key) {
            windFieldMap = [];
            stationsMap=[];
            //查看该市下有哪些变电站
            var stations=getStationByArea(key);
            //变电站数据规范化，HT数据格式保持一致
            stations.forEach(function (e) {
                let obj={};
                obj.id=e.id;
                obj.name=e.pro_name;
                if(e.postion==undefined){
                    obj.position={
                        'x': 960,
                        'y': 540
                    }
                }else{
                    obj.position={
                        'x': JSON.parse(e.postion).x,
                        'y': JSON.parse(e.postion).y
                    }
                }

                obj.value=12
                obj.volume='200MW'
                windFieldMap.push(obj)



                let stationObj={};
                stationObj.label=e.pro_name;
                stationObj.value=e.id;
                stationsMap.push(stationObj);
            })
            dataModel.getDataByTag('stations_comboBox').a('ht.dataSource',stationsMap);
            dataModel.getDataByTag('stations_comboBox').a('ht.value',"所有");
            document.getElementById("ht").innerHTML = "";
            var gd2 = new ht.graph.GraphView();
            view1=gd2;
            gd2.addToDOM(document.getElementById("ht"));
            gd2.deserialize('displays/冀北/资源评估与气象预警/zhangjiakou.json', function (json, dm, gd2, datas) {
                dataModel.getDataByTag('windButton').s('2d.visible', false);//风向图隐藏
                createNodes2(dm, windFieldMap,"zhangjiakou");
                gd2.addInteractorListener(e => {
                    var kind = e.kind;
                    var data = e.data;
                    var id;
                    if (data) {
                        id = data._id;
                    }
                    //悬浮报警灯
                    if(id==alarmid){
                        // var layers = gd2.getLayers();
                        // layers[2].visible = true;
                        //console.log('temp',temp);
                        var position = data._position;
                        var alarmCityTbale2 = dm.getDataByTag('alarmCityTbale2');
                        if ('onHover' == kind) {
                            alarmCityTbale2._position.x = position.x - 180;
                            alarmCityTbale2._position.y = position.y + 100;
                            alarmCityTbale2.a({
                                'ht.dataSource': [
                                    {
                                        "reason": "天桥山风电场 大风报警5级 功率损失：1224wv"
                                    },
                                    {
                                        "reason": "鹿原风电场 大风报警5级 功率损失：1024MW"
                                    }
                                ]
                            });
                            alarmCityTbale2.s('2d.visible', true);
                        }else if ('onLeave' === kind) {
                            alarmCityTbale2.s('2d.visible', false);
                        }
                    }

                    //悬浮风电场
                    var temp;
                    for (var i = 0; i < windFieldMap.length; i++) {
                        if (windFieldMap[i].id == id) {
                            temp = windFieldMap[i];
                            break;
                        }
                    };
                    if (temp) {
                        // var layers = gd2.getLayers();
                        // console.log(layers)
                        // layers[2].visible = true;
                        var position = data._position;

                        var alarmCityTbale2 = dm.getDataByTag('alarmCityTbale2');
                        if ('onHover' == kind) {
                            var arr=getstationwindtooltipArr(temp.id);
                            // console.log(arr)
                            alarmCityTbale2._position.x = position.x - 180;
                            alarmCityTbale2._position.y = position.y + 100;
                            alarmCityTbale2.a({
                                'ht.dataSource': arr
                            });
                            alarmCityTbale2.s('2d.visible', true);
                        }else if ('onLeave' === kind) {
                            alarmCityTbale2.s('2d.visible', false);
                        }
                    }

                });
            });
            setInterval(function () {
                if(areaId==5){
                    if(stationId_old!=stationId){
                        if(stationId_old!==0){
                            gd2.zoomReset(true, {x: view1.getDataModel().getDataByTag(stationId_old)._position.x, y: view1.getDataModel().getDataByTag(stationId_old)._position.y});
                        }
                        gd2.setZoom(1.5, true, {x: view1.getDataModel().getDataByTag(stationId)._position.x, y: view1.getDataModel().getDataByTag(stationId)._position.y});
                        var layers = view1.getLayers();
                        layers[1].visible = true;
                        layers[2].visible = true;
                        stationId_old=stationId;
                    }
                }
            }, 1000);
            graphView.addToDOM(gd2.getView());
        }
        function tangshan(key) {
            windFieldMap = [];
            stationsMap=[];
            //查看该市下有哪些变电站
            var stations=getStationByArea(key);
            //变电站数据规范化，HT数据格式保持一致
            stations.forEach(function (e) {
                let obj={};
                obj.id=e.id;
                obj.name=e.pro_name;
                if(e.postion==undefined){
                    obj.position={
                        'x': 960,
                        'y': 540
                    }
                }else{
                    obj.position={
                        'x': JSON.parse(e.postion).x,
                        'y': JSON.parse(e.postion).y
                    }
                }
                obj.value=12
                obj.volume='200MW'
                windFieldMap.push(obj)



                let stationObj={};
                stationObj.label=e.pro_name;
                stationObj.value=e.id;
                stationsMap.push(stationObj);
            })
            // console.log(stationsMap)
            dataModel.getDataByTag('stations_comboBox').a('ht.dataSource',stationsMap);
            dataModel.getDataByTag('stations_comboBox').a('ht.value',"所有");
            document.getElementById("ht").innerHTML = "";
            var gd2 = new ht.graph.GraphView();
            view1=gd2;
            gd2.addToDOM(document.getElementById("ht"));
            gd2.deserialize('displays/冀北/资源评估与气象预警/tangshan.json', function (json, dm, g2d, datas) {
                dataModel.getDataByTag('windButton').s('2d.visible', false);//风向图隐藏
                createNodes2(dm, windFieldMap,"tangshan");
                gd2.addInteractorListener(e => {
                    var kind = e.kind;
                    var data = e.data;
                    var id;
                    if (data) {
                        id = data._id;
                        console.log(id);
                    }
                    //悬浮报警灯
                    if(id==alarmid){
                        // var layers = gd2.getLayers();
                        // layers[2].visible = true;
                        //console.log('temp',temp);
                        var position = data._position;
                        var alarmCityTbale2 = dm.getDataByTag('alarmCityTbale2');
                        if ('onHover' == kind) {
                            alarmCityTbale2._position.x = position.x - 180;
                            alarmCityTbale2._position.y = position.y + 100;
                            alarmCityTbale2.a({
                                'ht.dataSource': [
                                    {
                                        "reason": "天桥山风电场 大风报警5级 功率损失：1224wv"
                                    },
                                    {
                                        "reason": "鹿原风电场 大风报警5级 功率损失：1024MW"
                                    }
                                ]
                            });
                            alarmCityTbale2.s('2d.visible', true);
                        }else if ('onLeave' === kind) {
                            alarmCityTbale2.s('2d.visible', false);
                        }
                    }

                    var temp;
                    for (var i = 0; i < windFieldMap.length; i++) {
                        if (windFieldMap[i].id == id) {
                            temp = windFieldMap[i];
                            break;
                        }
                    };
                    //悬浮风电场
                    if (temp) {
                        // var layers = gd2.getLayers();
                        // console.log(layers)
                        // layers[2].visible = true;
                        console.log(temp);
                        var position = data._position;

                        var alarmCityTbale2 = dm.getDataByTag('alarmCityTbale2');
                        if ('onHover' == kind) {
                            var arr=getstationwindtooltipArr(temp.id);
                            console.log(arr)
                            alarmCityTbale2._position.x = position.x - 180;
                            alarmCityTbale2._position.y = position.y + 100;
                            alarmCityTbale2.a({
                                'ht.dataSource': arr
                            });
                            alarmCityTbale2.s('2d.visible', true);
                        }else if ('onLeave' === kind) {
                            alarmCityTbale2.s('2d.visible', false);
                        }
                    }

                });
            });
            setInterval(function () {
                if(stationId_old!=stationId&&areaId==6){
                    console.log(view1.getDataModel().getDataByTag(stationId)._position.x);
                    console.log(view1.getDataModel().getDataByTag(stationId)._position.y);
                    if(stationId_old!==0){
                        gd2.zoomReset(true, {x: view1.getDataModel().getDataByTag(stationId_old)._position.x, y: view1.getDataModel().getDataByTag(stationId_old)._position.y});
                    }
                    gd2.setZoom(1.5, true, {x: view1.getDataModel().getDataByTag(stationId)._position.x, y: view1.getDataModel().getDataByTag(stationId)._position.y});
                    var layers = view1.getLayers();
                    layers[1].visible = true;
                    layers[2].visible = true;
                    stationId_old=stationId;
                }
            }, 1000);
            graphView.addToDOM(gd2.getView());//没有gd2.getView()，地图上的弹出框出不来
        }
        function langfang(key) {
            windFieldMap = [];
            stationsMap=[];
            //查看该市下有哪些变电站
            var stations=getStationByArea(key);
            //变电站数据规范化，HT数据格式保持一致
            stations.forEach(function (e) {
                let obj={};
                obj.id=e.id;
                obj.name=e.pro_name;
                if(e.postion==undefined){
                    obj.position={
                        'x': 960,
                        'y': 540
                    }
                }else{
                    obj.position={
                        'x': JSON.parse(e.postion).x,
                        'y': JSON.parse(e.postion).y
                    }
                }
                obj.value=12
                obj.volume='200MW'
                windFieldMap.push(obj)



                let stationObj={};
                stationObj.label=e.pro_name;
                stationObj.value=e.id;
                stationsMap.push(stationObj);
            })
            console.log(stationsMap)
            dataModel.getDataByTag('stations_comboBox').a('ht.dataSource',stationsMap);
            dataModel.getDataByTag('stations_comboBox').a('ht.value',"所有");
            document.getElementById("ht").innerHTML = "";
            var gd2 = new ht.graph.GraphView();
            view1=gd2;
            gd2.addToDOM(document.getElementById("ht"));
            gd2.deserialize('displays/冀北/资源评估与气象预警/langfang.json', function (json, dm, g2d, datas) {
                dataModel.getDataByTag('windButton').s('2d.visible', false);//风向图隐藏
                createNodes2(dm, windFieldMap,"langfang");
                gd2.addInteractorListener(e => {
                    var kind = e.kind;
                    var data = e.data;
                    var id;
                    if (data) {
                        id = data._id;
                        console.log(id);
                    }
                    //悬浮报警灯
                    if(id==alarmid){
                        // var layers = gd2.getLayers();
                        // layers[2].visible = true;
                        //console.log('temp',temp);
                        var position = data._position;
                        var alarmCityTbale2 = dm.getDataByTag('alarmCityTbale2');
                        if ('onHover' == kind) {
                            alarmCityTbale2._position.x = position.x - 180;
                            alarmCityTbale2._position.y = position.y + 100;
                            alarmCityTbale2.a({
                                'ht.dataSource': [
                                    {
                                        "reason": "天桥山风电场 大风报警5级 功率损失：1224wv"
                                    },
                                    {
                                        "reason": "鹿原风电场 大风报警5级 功率损失：1024MW"
                                    }
                                ]
                            });
                            alarmCityTbale2.s('2d.visible', true);
                        }else if ('onLeave' === kind) {
                            alarmCityTbale2.s('2d.visible', false);
                        }
                    }

                    var temp;
                    for (var i = 0; i < windFieldMap.length; i++) {
                        if (windFieldMap[i].id == id) {
                            temp = windFieldMap[i];
                            break;
                        }
                    };
                    //悬浮风电场
                    if (temp) {
                        // var layers = gd2.getLayers();
                        // console.log(layers)
                        // layers[2].visible = true;
                        console.log(temp);
                        var position = data._position;

                        var alarmCityTbale2 = dm.getDataByTag('alarmCityTbale2');
                        if ('onHover' == kind) {
                            var arr=getstationwindtooltipArr(temp.id);
                            console.log(arr)
                            alarmCityTbale2._position.x = position.x - 180;
                            alarmCityTbale2._position.y = position.y + 100;
                            alarmCityTbale2.a({
                                'ht.dataSource': arr
                            });
                            alarmCityTbale2.s('2d.visible', true);
                        }else if ('onLeave' === kind) {
                            alarmCityTbale2.s('2d.visible', false);
                        }
                    }

                });
            });
            setInterval(function () {
                if(stationId_old!=stationId&&areaId==7){
                    console.log(view1.getDataModel().getDataByTag(stationId)._position.x);
                    console.log(view1.getDataModel().getDataByTag(stationId)._position.y);
                    if(stationId_old!==0){
                        gd2.zoomReset(true, {x: view1.getDataModel().getDataByTag(stationId_old)._position.x, y: view1.getDataModel().getDataByTag(stationId_old)._position.y});
                    }
                    gd2.setZoom(1.5, true, {x: view1.getDataModel().getDataByTag(stationId)._position.x, y: view1.getDataModel().getDataByTag(stationId)._position.y});
                    var layers = view1.getLayers();
                    layers[1].visible = true;
                    layers[2].visible = true;
                    stationId_old=stationId;
                }
            }, 1000);
            graphView.addToDOM(gd2.getView());//没有gd2.getView()，地图上的弹出框出不来
        }
        function qinhuangdao(key) {
            //该数组暂时保留一个静态数据
            windFieldMap = [];
            stationsMap=[];
            //查看该市下有哪些变电站
            var stations=getStationByArea(key);
            //变电站数据规范化，HT数据格式保持一致
            stations.forEach(function (e) {
                let obj={};
                obj.id=e.id;
                obj.name=e.pro_name;
                if(e.postion==undefined){
                    obj.position={
                        'x': 960,
                        'y': 540
                    }
                }else{
                    obj.position={
                        'x': JSON.parse(e.postion).x,
                        'y': JSON.parse(e.postion).y
                    }
                }
                obj.value=12
                obj.volume='200MW'
                windFieldMap.push(obj)



                let stationObj={};
                stationObj.label=e.pro_name;
                stationObj.value=e.id;
                stationsMap.push(stationObj);
            })
            console.log(stationsMap)
            dataModel.getDataByTag('stations_comboBox').a('ht.dataSource',stationsMap);
            dataModel.getDataByTag('stations_comboBox').a('ht.value',"所有");
            document.getElementById("ht").innerHTML = "";
            var gd2 = new ht.graph.GraphView();
            view1=gd2;
            gd2.addToDOM(document.getElementById("ht"));
            gd2.deserialize('displays/冀北/资源评估与气象预警/qinhuangdao.json', function (json, dm, g2d, datas) {
                dataModel.getDataByTag('windButton').s('2d.visible', false);//风向图隐藏
                createNodes2(dm, windFieldMap,"qinhuangdao");
                gd2.addInteractorListener(e => {
                    var kind = e.kind;
                    var data = e.data;
                    var id;
                    if (data) {
                        id = data._id;
                        console.log(id);
                    }
                    //悬浮报警灯
                    if(id==alarmid){
                        // var layers = gd2.getLayers();
                        // layers[2].visible = true;
                        //console.log('temp',temp);
                        var position = data._position;
                        var alarmCityTbale2 = dm.getDataByTag('alarmCityTbale2');
                        if ('onHover' == kind) {
                            alarmCityTbale2._position.x = position.x - 180;
                            alarmCityTbale2._position.y = position.y + 100;
                            alarmCityTbale2.a({
                                'ht.dataSource': [
                                    {
                                        "reason": "天桥山风电场 大风报警5级 功率损失：1224wv"
                                    },
                                    {
                                        "reason": "鹿原风电场 大风报警5级 功率损失：1024MW"
                                    }
                                ]
                            });
                            alarmCityTbale2.s('2d.visible', true);
                        }else if ('onLeave' === kind) {
                            alarmCityTbale2.s('2d.visible', false);
                        }
                    }

                    var temp;
                    for (var i = 0; i < windFieldMap.length; i++) {
                        if (windFieldMap[i].id == id) {
                            temp = windFieldMap[i];
                            break;
                        }
                    };
                    //悬浮风电场
                    if (temp) {
                        // var layers = gd2.getLayers();
                        // console.log(layers)
                        // layers[2].visible = true;
                        console.log(temp);
                        var position = data._position;

                        var alarmCityTbale2 = dm.getDataByTag('alarmCityTbale2');
                        if ('onHover' == kind) {
                            var arr=getstationwindtooltipArr(temp.id);
                            console.log(arr)
                            alarmCityTbale2._position.x = position.x - 180;
                            alarmCityTbale2._position.y = position.y + 100;
                            alarmCityTbale2.a({
                                'ht.dataSource': arr
                            });
                            alarmCityTbale2.s('2d.visible', true);
                        }else if ('onLeave' === kind) {
                            alarmCityTbale2.s('2d.visible', false);
                        }

                    }

                });
            });
            setInterval(function () {
                if(stationId_old!=stationId&&areaId==9){
                    if(stationId_old!==0){
                        gd2.zoomReset(true, {x: view1.getDataModel().getDataByTag(stationId_old)._position.x, y: view1.getDataModel().getDataByTag(stationId_old)._position.y});
                    }
                    gd2.setZoom(1.5, true, {x: view1.getDataModel().getDataByTag(stationId)._position.x, y: view1.getDataModel().getDataByTag(stationId)._position.y});
                    var layers = view1.getLayers();
                    layers[1].visible = true;
                    layers[2].visible = true;
                    stationId_old=stationId;
                }
            }, 1000);
            graphView.addToDOM(gd2.getView());//没有gd2.getView()，地图上的弹出框出不来
        }


        //创建5市风机node和是否显示报警灯
        function createNodes(dm, datas,getCityAlarmObj) {
            var host = dm.getDataByTag("zhangjiakou").getHost();
            for (var i = 0; i < datas.length; i++) {
                //debugger
                var node = new ht.Node();
                node.setLayer('0');
                node.setImage('symbols/冀北大数据/场站.json');
                node.setHost(host);
                var node2 = new ht.Node();
                node2.setLayer('0');
                node2.setImage('symbols/冀北大数据/报警灯.json');
                node2.setHost(host);
                //node.s('2d.visible', false);
                var temp = datas[i];
                if (temp.name) {
                    var name = temp.name;
                    //node.setName(name);  //可以直接将name在图标下面展示
                    node.a('changzhan_name', name);
                    node.setDisplayName(name);
                    node2.setDisplayName(name+"alarm");
                }
                if (temp.position) {
                    //设置图元矩形区域
                    node.setRect(temp.position.x, temp.position.y, 60, 78);
                    node2.setRect(temp.position.x+60, temp.position.y+30, 64, 50);
                    //node.setPosition(temp.position.x, temp.position.y);
                }
                if (temp.id) {
                    node.setId(temp.id);
                    node2.setId(temp.id+"alarm");
                } else {
                    node.setId(1000 + i);
                    node2.setId(1000 + i+"alarm");

                }
                node.s('2d.movable',false);
                node2.s('2d.movable',false);
                dm.add(node);
                if(getCityAlarmObj[temp.name]!==undefined&&getCityAlarmObj[temp.name]!==null) {
                    dm.add(node2);
                }
            }

            //  return node;
        };
        //创建当前选择市区风机node，现在都显示报警灯
        function createNodes2(dm, datas,position) {
            var host = dm.getDataByTag(position).getHost();
            for (var i = 0; i < datas.length; i++) {
                var node = new ht.Node();
                if(i<1){
                    node.setLayer('0');
                    console.log(datas[i]);
                }else if(i<3){
                    node.setLayer('1');
                    console.log(datas[i]);
                }else{
                    node.setLayer('2');
                    console.log(datas[i]);
                }

                node.setImage('symbols/冀北大数据/场站.json');
                node.setHost(host);
                var node2 = new ht.Node();
                if(i<1){
                    node2.setLayer('0');
                }else if(i<3){
                    node2.setLayer('1');
                }else{
                    node2.setLayer('2');
                }
                node2.setImage('symbols/冀北大数据/报警灯.json');
                node2.setHost(host);
                //node.s('2d.visible', false);
                var temp = datas[i];
                if (temp.name) {
                    var name = temp.name;
                    //node.setName(name);  //可以直接将name在图标下面展示
                    node.a('changzhan_name', name);
                    node.setDisplayName(name);
                    node2.setDisplayName(name+"alarm");
                }
                if (temp.position) {
                    //设置图元矩形区域
                    node.setRect(temp.position.x, temp.position.y, 40, 58);
                    node2.setRect(temp.position.x+100, temp.position.y+30, 64, 50);
                    //node.setPosition(temp.position.x, temp.position.y);
                }
                if (temp.id) {
                    node.setId(temp.id);
                    node.setTag(temp.id);
                    node2.setId(temp.id+"alarm");
                } else {
                    node.setId(1000 + i);
                    node2.setId(1000 + i+"alarm");

                }
                node.s('2d.movable',false);

                dm.add(node);
                // dm.add(node2);
            }
        };


        function running(tabledata) {
            if(tabledata.length==1){
                maxPageNum=1;
            }else if(tabledata.length==2){
                maxPageNum=2;
            }else if(tabledata.length==3){
                maxPageNum=3;
            }else{
                maxPageNum=3;
            }

            for (var i = 0; i < tabledata.length; i++) {
                var tmp = tabledata[i];
                tmp['id'] = i;
            }
            return tabledata;
        }
        //变换数据
        function changeData(tabledata, startId, showTableData) {
            showTableData = [];
            var flag = true;
            for (var i = 0; i < maxPageNum; i++) {
                if (startId + i >= tabledata.length) {
                    startId = 0;
                    flag = false;
                    // showTableData.splice(i - 1);
                    break;
                }
                showTableData[i] = tabledata[startId + i];
            }
            var table = dataModel.getDataByTag('tt');
            table.a({
                'ht.dataSource': showTableData
            });
            if (flag) {
                startId = startId + maxPageNum;
            }
            return startId;
        }

        //右侧风向风速图
        function getwindSpeedChart(year){
            var obj={};
            $.ajax({
                type : "GET",
                async : false, //同步请求
                data:{
                    "year":year
                },
                url : attributeConfig.url+"/epplatform/v1/resourceMeteorological/getWholeWindSpeed",
                contentType: "application/json; charset=utf-8",
                success:function(data){
                    if(data.code==0){
                        obj=data.data;
                        dataModel.getDataByTag('windspeedLinechart').a("xData",obj.speedX);
                        dataModel.getDataByTag('windspeedLinechart').a("yData",obj.speedY);
                        var colorArr=["#28FF28","#1AFD9C","#9999CC","#DCB5FF","#FFAF60","#8CEA00","#ff6867","#28FF28","#1AFD9C","#FFAF60","#ff6867","#8CEA00","#1AFD9C","#ff6867","#ff6867","#28FF28"];
                        var directionYArr=[];

                        obj.directionY.forEach(function (e,index) {
                            var itemObj={
                                "value": e,
                                "itemStyle": {
                                    "color": colorArr[index]
                                }
                            };
                            directionYArr.push(itemObj);
                        })
                        dataModel.getDataByTag('windroseChart').a("xData",obj.directionX);
                        dataModel.getDataByTag('windroseChart').a("yData",directionYArr);
                    }
                },
                error: function() {
                    console.log("请求城市失败，请稍后再试！");
                }
            });
            return obj;
        }
        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return decodeURI(r[2]);
            return null;
        }
    </script>
</head>

<body onload='init()'>
    <div id="map" onpaste="return false">
        <canvas id="mycanvas" onpaste="return false" ondragstart="return false;"></canvas>
    </div>
    <div id="ht"></div>
</body>
	 <!-- <link rel="stylesheet" href="../custom/libs/资源评估气象预警/js/leaflet-1.3/leaflet.css" /> -->
    <!-- <script src='../custom/libs/资源评估气象预警/js/jquery/jquery.js'></script> -->
    <!-- <script src='../custom/libs/资源评估气象预警/js/leaflet-1.3/leaflet.js'></script> -->
    <!-- <script src='../custom/libs/资源评估气象预警/js/leaflet-windy/windy.js'></script> -->
	 <!-- <script src='../custom/libs/资源评估气象预警/js/show-windy.js'></script> -->
	 	 <link rel="stylesheet" href="custom/libs/资源评估气象预警/js/leaflet-1.3/leaflet.css" />
    <script src='custom/libs/资源评估气象预警/js/leaflet-1.3/leaflet.js'></script>
    <script src='custom/libs/资源评估气象预警/js/leaflet-windy/windy.js'></script>
	 <script src='custom/libs/资源评估气象预警/js/show-windy.js'></script>
</html>
